import json
import sys
import os

ar_json = {}
key_name_arr = [
    "project_name",
    "branch_name",
    "git_path",
    "sub_path",
    "port",
    "scp_project_name",
    "project_type",
    "groupid",
    "artifactid",
]
parent_folder_name = sys.argv[1]
files = os.listdir(parent_folder_name)
for file in files:
    with open(os.path.join(parent_folder_name, file), "r") as f:
        ar_json = json.load(f)
        # ar_json["database_user_name"] = "yapai"
        # ar_json["database_password"] = "ypkj@1234"
        # ar_json["database_port"] = "3306"
        ar_json["update_version"] = "true"
    with open(os.path.join(parent_folder_name, file), "w") as f:
        f.write(json.dumps(ar_json, indent=4, ensure_ascii=False))
